#pragma once
#include <list>
#include <mutex>
#include <QThread>
#include "IVideoCall.h"
struct AVPacket;
struct AVCodecParameters;
class XDecode;
class XVideoThread:public QThread
{
public:
	virtual bool Open(AVCodecParameters *para, IVideoCall *call, int width, int height);
	virtual void Push(AVPacket *pkt);
	void run();
	XVideoThread();
	virtual ~XVideoThread();

	int maxList = 200;
	bool isExit = false;

	//同步时间，由外部传入
	long long synpts = 0;
	long long pts = 0;
protected:
	std::list <AVPacket *> packs;
	std::mutex videomux;
	XDecode *decode = 0;
	IVideoCall *call = 0;
};

